package com.boat.framework.common.monitor.event;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 第三方系统调用出错
 * 需要业务系统自己用拦截器组装并打印日志
 * 
 * @author 周江
 *
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
public class TrdPartyCallFailed extends BaseMonitorEvent {
	/**
	 * 错误类型
	 */
	private String exceptionType;
	/**
	 * 异常消息
	 */
	private String exceptionMsg;
	/**
	 * 备注
	 */
	private String remark;

	public TrdPartyCallFailed() {
		super();
	}

	public TrdPartyCallFailed(String urlStr, Exception ex) {
		super();
		setName(urlStr);
		
		setExceptionType(
				ex.getCause() != null ? ex.getCause().getClass().getSimpleName() : ex.getClass().getSimpleName());
		setExceptionMsg(ex.getCause() != null ? ex.getCause().getMessage() : ex.getMessage());
		setRemark("第三方系统调用出错");
	}
}
